<template>
  <div class="card-container">
    <!-- Header with icon and title -->
    <div class="card-header">
      <div class="header-icon">
        <span>👍</span>
      </div>
      <h2 class="quick-header-title">快速开始</h2>
      <RouterLink to="/more" class="more-link">更多</RouterLink>
    </div>

    <!-- Card items -->
    <div class="card-items">
      <div class="card-item" v-for="(item, index) in items" :key="index">
        <div class="item-content">
          <h3 class="item-title">英语学习方法</h3>
          <p class="item-date">2024.8.27</p>
        </div>
        <div class="item-footer">
          <div class="item-icons">
            <span class="star-icon">⭐</span>
            <span class="delete-icon">🗑️</span>
          </div>
          <span class="item-text">共110条对话</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue';

// Mock data for card items
const items = ref([
  { id: 1, title: "英语学习方法", date: "2024.8.27", conversations: "共110条对话" },
  { id: 2, title: "英语学习方法", date: "2024.8.27", conversations: "共110条对话" },
  { id: 3, title: "英语学习方法", date: "2024.8.27", conversations: "共110条对话" },
  { id: 4, title: "英语学习方法", date: "2024.8.27", conversations: "共110条对话" },
  { id: 5, title: "英语学习方法", date: "2024.8.27", conversations: "共110条对话" }
]);
</script>

<style scoped>
.card-container {
  margin-top: 70px;
  width: 90%;
  margin: auto;
  padding: 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
}

.header-icon {
  font-size: 24px;
  color: #007bff;
}

.quick-header-title {
  font-size: 20px;
  font-weight: bold;
  color: #007bff;
  margin-left: 10px;
}

.more-link {
  font-size: 14px;
  color: #007bff;
  text-decoration: none;
}

.card-items {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.card-item {
  width: calc(30% - 16px);
  height: 40px;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  transition: transform 0.3s;
}

.card-item:hover {
  transform: translateY(-5px);
}

.item-content {
  display: flex;
  flex-direction: column;
}

.item-title {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin: 5px 0 -10px 0;
}

.item-date {
  font-size: 14px;
  color: #666;
  padding: 0;
  margin: 10px 0 0 0;
}

.item-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.item-text {
  font-size: 12px;
  color: #666;
}

.item-icons {
  display: flex;
  gap: 10px;
  font-size: 18px;
  margin-bottom: 5px;
}

.star-icon {
  color: #ffc107;
  cursor: pointer;
}

.delete-icon {
  color: #dc3545;
  cursor: pointer;
}
</style>
